import 'package:flutter/material.dart';
import 'dart:math';
import 'Function.dart';
import 'allFunctionQuantities.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      theme: ThemeData.dark(),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  //final _TextFeildMyAreaW = new TextEditingController();
  final W_TextFeildMyAreaW = new TextEditingController();
  final H_TextFeildMyAreaW = new TextEditingController();

  String TextOute = "";
  String W_AND_H_MyArea(String Width, String Length) {
    num ss, dd, ff;
    ss = num.parse(Width);
    dd = num.parse(Length);
    ff = (ss * dd) / 0.08;
    String StringArea = "";
    return StringArea = ff.toString();
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("حساب البلك"),
        backgroundColor: Colors.black87,
      ),
      body:

      Column(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.only(top: 33,right: 35,left: 35),
            child: Card(
              child: TextFormField(
                decoration: InputDecoration(
                  labelText: ' عرض الحائط بالمتر ',
                ),
                controller: W_TextFeildMyAreaW,
                keyboardType: TextInputType.number,
              ),
            ),
          ),
          Padding(
            padding: const EdgeInsets.only(bottom:33,right: 35,left: 35),
            child: Card(
              child: TextFormField(
                decoration: InputDecoration(
                  labelText: ' طول الحائط بالمتر ',
                ),
                controller: H_TextFeildMyAreaW,
                keyboardType: TextInputType.number,
              ),
            ),
          ),
          buildInkWell()
          //buildCard(),
        ],
      ),
    );
  }

  InkWell buildInkWell() {
    return InkWell(
      child: Card(
        child: Padding(
          padding: const EdgeInsets.all(16),
          child: Column(children: <Widget>[
          Text(" عدد البلك المطلوب = "+TextOute,style: TextStyle(fontSize: 24,),),
        ],),
        ),
      ),
    onTap: () {
        setState(() {
          var W_MyAreaW = W_TextFeildMyAreaW.text;
          var H_MyAreaW = H_TextFeildMyAreaW.text;

          TextOute = W_AND_H_MyArea(W_MyAreaW, H_MyAreaW);
        });
      },
    );
  }

}
